/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package lhs;

import java.util.ArrayList;

/**
 *
 * @author Andy
 */
public class LHS {
    
    private ArrayList<Harbor> harborList;

    public LHS()
    {
        harborList = new ArrayList<Harbor>();
        
        Harbor h1 = new Harbor("H1", 90, 4.5);
        Harbor h2 = new Harbor("H2", 80, 7);
        Harbor h3 = new Harbor("H3", 270, 9.5);
        
        
        harborList.add(h1);
        harborList.add(h2);
        harborList.add(h3);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        GUI gui = new GUI();
        gui.setVisible(true);
    }
    
    public Harbor getHarbor(String name)
    {
        Harbor temp = null;
        
        for(Harbor h : harborList)
        {
           if(h.getName().equals(name))
           {
               temp = h;
               return temp;
           }
        }
        return null;
    }
    
    public ArrayList getHarborList()
    {
        ArrayList<Harbor> temp = new ArrayList<Harbor>();
        
        for(Harbor h : harborList)
        {
            temp.add(h);
        }
        return temp;
    }
    
    public String getHarborName(String s)
    {
        String name = null;
        String temp = null;
        
        for(Harbor h : harborList)
        {
            name = h.getShip().getName();
            if(name.equals(s))
            {
                temp = h.getName();
            }
        }
        
        return temp;
    }
    
}
